<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Vue 的实例对象</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
<!-- 挂载点 -->
<div>
    <div id="app1">
        <!-- 实例属性ref相对于id -->
        <button ref="mybtn1" id="btn1" @click="hanleClick1">点我</button>
        <button ref="mybtn2" id="btn2" @click="hanleClick2">点我</button>
    </div>
</div>

<script type="text/javascript">
    // Vue 的实例
    var v1 = new Vue({
        el: '#app1',
        methods: {
            hanleClick1: function () {
                this.$refs.mybtn1.innerHTML = '通过实例属性变脸'
            },
            hanleClick2: function () {
                this.$refs.mybtn2.innerHTML = '通过实例属性变脸'
            },
        }
    })
</script>
</body>
</html>